1. Field of the Invention
The present invention relates to computer data storage. More particularly, the present invention relates to organizing and controlling quoted space or time in computer data storage.
2. Description of Related Art
A computer file system is used to control and organize the process of computer data storage. It can be implemented as part of a computer operating system intended to provide users with a handy interface when working with data (e.g., files) stored on a computer storage device and to provide mutual use of data by several users and processes.
More specifically, a computer file system includes files stored on a computer storage device (e.g., a disk) and a set of data structures used to control the files, such as file directories, file descriptors, distribution tables for free and occupied space on the storage device, etc. In operation, a file system may perform a plurality of tasks, such as accessing files stored on the computer storage device, providing data cashing, fault tolerance, etc.
The task to provide quota on a computer storage device (i.e., disk quota management) appeared as a result of a multi-user mode of computer usage. An example of such computer usage is provided in The Design and Implementation of the 4.4BSD Operating System (Unix and Open Systems Series) by Marshall Kirk McKusick (Editor), Keith Bostic and Michael J. Karels (Editor), Addison-Wesley Pub Co; ISBN: 0201549794, p 253-256.
Quota management can be used to restrict the use of operating system resources and can be based on different criteria, such as belonging to a user or directory. Specifically, disk quota management limits availability of disk resources for file system users. Without disk quota management, users can utilize as much disk space as they want. Such utilization may adversely affect system efficiency because other users, as well as the operating system itself, may not access sufficient disk space. A system having disk quota management limits the maximum disk space available to users and guarantees there will be always enough disk space for system operations. Therefore, fault tolerance of the system is increased in a system having disk quota management.
Although systems providing disk quota management are embedded into many operating systems (OSes), some OSes do not have disk quotas or they are not safely implemented. For example, old versions of Microsoft Windows NT (including version 4.0 and prior) did not have disk quota management systems.
In OSes that do have disk quota management systems, there are two main quota types—user quotas and directory quotas. User quotas are based on user criteria; that is, each user has a limit of disk space, file number, etc. Directory quotas are based on directory criteria; that is, each directory has a limit of disk space, file number, etc. In some conventional file systems directory quotas are called tree quotas. Tree quotas limit the number and size of files in the sub-tree of the file system for all users without separating them.
Quotas can be described as either hard quotas or soft quotas. A hard quota cannot be exceeded. As the user achieves the limits of the hard quota, the resources of the corresponding file system are no longer allocated to that user. For example, if the user has a hard quota of 500 blocks in the file system and currently is using 490 blocks, then the user can obtain only ten (10) additional blocks. Any attempt to access eleven (11) or more blocks will fail.
A soft quota can be exceeded during some period of time. This period is also called a delay or grace period (e.g. a week). If the user exceeds her soft quota in excess of the grace period, then the soft quota becomes a hard quota and further allocation of resources will be banned. When the user returns to the level below the soft quota, the delay period is reset.
Mechanisms for quota calculation or recalculation have various implementations. In some operating systems, a quota to user files is recalculated during authorization of the user. Such an approach however, results in serious time delays. Other implementations provide quota recalculation at some moment in time. During a time period between recalculation, users can seriously exceed the allowed quota. Accordingly, the most up-to-date implementation recalculates a quota during particular operations with a file. The recalculation can be done when an operation is performed by intercepting the operation at the level of the file system driver. Analysis of user's permissibility also can be done subsequent to performing the operation. However, in the latter case the user can considerably exceed her quota by saving a large file.
There are two other methods to accomplish quota recalculation. The first method is when an operating system reviews all its files, finds the files owned by the user, calculates the size of the user's files, and decides on permissibility of the user's further file operations. This method leads to long recalculating delays and should not be implemented for quota analysis on each user's file operations. The preferred (or more effective) method for quota recalculation is when an operating system (or any other service) maintains records in a quota database. In this implementation, current quotas and the space occupied by each user are stored in the database. It is thus necessary to track each file operation affecting the space size and, correspondingly, modify values in the database.
Therefore, according to the foregoing, quota methods, when properly implemented, can provide obvious advantages to computer file systems, such as increasing system failure tolerance. But, technical implementation of quotas brings some problems. Among the potential problems are when and how is it necessary to determine who among a plurality of users owns a file. Based on that determination, how should the user's quota for that file be checked. More specifically, for example, a file can be both a logical and physical notion. Physically, a file can take less space than logically; that is, it can be compressed by file system tools. Thus, as the system has physical disk space constraints, a question arises as to what size or quantitative parameter of resource should be taken into account when a quota is defined. Similarly, one file may have several representations under different names, in different directories, and so on. Physically, a file takes only one space. Therefore, for correct (or proper) implementation of quotas, it is necessary to take into account various nuances of logical and physical implementation of the file systems.
Accordingly, it would be desirable to provide a method and system for the implementation of data storage quotas (e.g., disk quotas) that overcomes the above-described technical problems. More particularly, it is desirable to provide a method and system of implementation of data storage quotas that pays special attention to the issues of mounting file systems and user accounts. Furthermore, it is desirable to provide a method and system that allows for a single partition of a file system (e.g., a mount point) with a plurality of quotable areas having a separate (i.e., having their own) set of quota limitations.